fix(prerender): emit /app/checkout + /app/billing SPA shells (HTTP 200, was 404)#144
Merged
Conversation
…0, was 404) UI-3 from the QA backlog (P2). External CTA entries to /app/checkout (from /pricing → "Start Pro") and /app/billing (from magic-link → "manage billing") shipped HTTP 404 status. Body hydrated correctly via GH Pages' 404.html SPA fallback (catch-all React Route picks up the path on hydrate), but the status code lied — analytics noise + tab-strip title flash + SEO confusion if the URLs were ever indexed. Root cause: scripts/prerender.mjs Step 4.6 emits pre-generated SPA shells for /login, /login/callback, /claim, /cli-auth, but no /app/* sub-paths. /app itself gets a shell (Step 4.5), but bookmarked /app/checkout and /app/billing direct hits never get HTTP 200. Fix: add /app/checkout and /app/billing to Step 4.6's authShellRoutes. GH Pages now serves dist/app/checkout/index.html and dist/app/billing/index.html with HTTP 200; the SPA hydrates as before. Other /app/* deep links (/app/resources/<id>, etc.) stay on the 404 fallback — they aren't external CTA destinations and aren't worth pre-generating with static paths. Also add ROUTE_META entries for both routes so the pre-rendered <title> shows "Checkout · instanode" / "Billing · instanode" instead of bleeding through the homepage title. Verified via gate (npm run build): dist/app/checkout/index.html → exists, <title>Checkout · instanode</title> dist/app/billing/index.html → exists, <title>Billing · instanode</title> Regression coverage in src/prerender.test.ts: - both new routes appear in the authShellRoutes literal - original 4 auth routes still present - ROUTE_META has titles for both new routes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
size-limit report 📦
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UI-3 from the QA backlog (P2). External CTA entries to
/app/checkout(from/pricing→ "Start Pro") and/app/billing(from magic-link → "manage billing") shipped HTTP 404 status. Body hydrated correctly via GH Pages'404.htmlSPA fallback, but the status code lied — analytics noise + tab-strip title flash + SEO confusion if either URL were ever indexed.Root cause
scripts/prerender.mjsStep 4.6 emits pre-generated SPA shells for/login,/login/callback,/claim,/cli-auth, but no/app/*sub-paths./appitself gets a shell (Step 4.5), but bookmarked/app/checkoutand/app/billingdirect hits never get HTTP 200.Fix
Add
/app/checkoutand/app/billingto Step 4.6'sauthShellRoutes. GH Pages servesdist/app/checkout/index.htmlanddist/app/billing/index.htmlwith HTTP 200; the SPA hydrates as before.Other
/app/*deep links (/app/resources/<id>, etc.) stay on the 404 fallback — they aren't external CTA destinations and aren't worth pre-generating with static paths.Also adds ROUTE_META entries for both routes so the pre-rendered
<title>showsCheckout · instanode/Billing · instanodeinstead of bleeding through the homepage title.Gate verification
Live verify (after merge)
Regression coverage
src/prerender.test.ts(new) — static check onscripts/prerender.mjs:authShellRoutesliteralROUTE_METAhas titles for both new routes🤖 Generated with Claude Code